<div ng-include="'html/component/nav.html'" ng-controller="NavCtrl"></div>
<ul class="set_item" ng-include="'html/component/left_nav.html'" ng-controller="SettingNavCtrl"></ul>
<div class="set_box">
    <h1 class="set_title" ><!--库存同步设置-->{{language.TIPS_SET_STOCK_PARAM_SYNC}}<i class="help" id="help_stockSynch" ng-click="help_prompt(language.HELP_PROMPT_STOCKSYNCH,'help_stockSynch')"></i><span class="title_btn_group"  ng-model="master"> <span class="title_btn" ng-click="synchro();">{{language.TIPS_SET_SYNC_NOW}}</span> <span class="title_btn" ng-click="save();">{{language.ACT_SAVE}}</span> </span></h1>
    <div class="set_cont stock_synch">
        <ul class="synch_box synch_set">
            <li class="title">
                <!--同步设置-->
                {{language.TIPS_SET_SYNC_SET}}
            </li>
            <li class="synch_item">
                <div class="name">
                    <!--是否开启同步-->
                    {{language.TIPS_SET_IS_START_SYNC}}：
                </div>
                <div class="val">
                    <p class="radio_wrap">
                        <input type="radio" name="synch_switch" id="synch_switch0" value="0" ng-model="configData.is_syn" ng-click="changeSyn0();"/>
                        <label for="synch_switch0" ng-class="{true:'curr',false:''}[configData.is_syn==0]">{{language.TIPS_SET_YES}}</label>
                        <input type="radio" name="synch_switch" id="synch_switch1" value="1" ng-model="configData.is_syn" ng-click="changeSyn1();"/>
                        <label for="synch_switch1" ng-class="{true:'curr',false:''}[configData.is_syn==1]">{{language.TIPS_SET_NO}}</label>
                    </p>
                </div>
            </li>
            <li class="synch_item" ng-if="configData.is_syn==0">
                <div class="name">
                    <!--同步频率设定-->
                    {{language.TIPS_SET_SYNC_HZ}}：
                </div>
                <div class="val">
                    <p class="radio_wrap">
                        <input type="radio" name="synch_frequency" id="synch_frequency1" value="1" ng-model="configData.frequency"/>
                        <label for="synch_frequency1" ng-class="{true:'curr',false:''}[configData.frequency==1]">30{{language.TIPS_SET_MIN}}</label>
                        <input type="radio" name="synch_frequency" id="synch_frequency2" value="2" ng-model="configData.frequency"/>
                        <label for="synch_frequency2" ng-class="{true:'curr',false:''}[configData.frequency==2]">1{{language.TIPS_SET_HOUR}}</label>
                        <input type="radio" name="synch_frequency" id="synch_frequency3" value="3" ng-model="configData.frequency"/>
                        <label for="synch_frequency3" ng-class="{true:'curr',false:''}[configData.frequency==3]">6<!--小时-->{{language.TIPS_SET_HOUR}}</label>
                        <input type="radio" name="synch_frequency" id="synch_frequency4" value="4" ng-model="configData.frequency"/>
                        <label for="synch_frequency4" ng-class="{true:'curr',false:''}[configData.frequency==4]">12<!--小时-->{{language.TIPS_SET_HOUR}}</label>
                        <input type="radio" name="synch_frequency" id="synch_frequency5" value="5" ng-model="configData.frequency"/>
                        <label for="synch_frequency5" ng-class="{true:'curr',false:''}[configData.frequency==5]">24<!--小时-->{{language.TIPS_SET_HOUR}}</label>
                    </p>
                </div>
            </li>
        </ul>
        <ul class="synch_box synch_result">
            <li class="title">
                <!--同步结果-->
                {{language.TIPS_SET_SYNC_RESULT}}
            </li>
            <li class="result_table">
                <table>
                    <tr>
                        <th>
                            <input type="checkbox" id="only_switch" ng-model="check" ng-click="showFail(check)"/>
                            <label for="only_switch"><!--只显示同步失败-->{{language.TIPS_SET_SHOW_SYNC_DEFEAT}}</label></th>
                        <th>SKU</th>
                        <th><!--商品名称-->{{language.TIPS_SET_SYNC_SET}}</th>
                        <th><!--最近同步时间-->{{language.TIPS_SET_SYNC_TIME_NEARLY}}</th>
                        <th><!--结果-->{{language.TIPS_SET_RESULT}}</th>
                        <th><!--原因-->{{language.TIPS_SET_REASON}}</th>
                    </tr>
                    <tr ng-repeat="res in results|orderBy:'time':'true' track by $index">
                        <td>
                            <button ng-click="synstock(res.syn);">
                                {{res.syn| syn_stock}}
                            </button></td>
                        <td>{{res.sku}}</td>
                        <td>{{res.name}}</td>
                        <td>{{res.time|date:'yyyy-MM-dd'}}</td>
                        <td>{{res.result| syn_result}}</td>
                        <td >{{res.reason}}</td>
                    </tr>
                </table>
            </li>
        </ul>
    </div>
</div>
